<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
	function send(){
		var id=document.form.id.value;
		var pw=document.form.pw.value;
		if(id==""){
			alert("id를 입력하세요");
			document.form.id.focus();
			return false; //return : 다음 문장 실행 안함
		}
		if(pw==""){
			alert("비밀번호를 입력하세요");
			document.form.pw.focus();
			return false; //return : 다음 문장 실행 안함
		}
		
		document.form.submit();
	}
	
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form name="form" method="post" action="loginresult.jsp">
	<table border="1" width="200" height="200" align="center">
	<tr>
    <td colspan="2" align="center">로그인</td>
   </tr>
   <tr>
    <td align="center">ID</td>
    <td align="center"><input type="text" name="id"></td>
   </tr>
   <tr>
    <td align="center">PW</td>
    <td align="center"><input type="password" name="pw"></td>
   </tr>
   <tr>
    <td colspan="2" align="center"><input type="button" value="로그인" onclick = "send()">
     <input type="reset" value="RESET">
   </tr>
  </table>
 </form>
</body>
</html>